//
//  ASJObject.h
//  ASJ001
//
//  Created by zephyrhan on 11/13/11.
//  Copyright (c) 2011 Ebrothers tech. All rights reserved.
//

#import "cocos2d.h"
#import "ASJSkill.h"
#import "ASJStage.h"


typedef enum {
    
    ASJRUNSKILLRET_OK           = 0,
    ASJRUNSKILLRET_COOLING      = 1,
    ASJRUNSKILLRET_NOTSTOPABLE  = 2,
    ASJRUNSKILLRET_NOTFOUND     = 3
    
} ASJRunSkillResult;


@interface ASJObject : NSObject {
    
    CGPoint movingSpeed;   // move to right if speed is larger than 0, else move to left
    CGFloat attackRate;    // number of acctack in a second
    CGFloat attackRange;
    CGFloat ATP;           // attact power 
    CGFloat HP;            // zero to die
    
    CGPoint currentMovingSpeed;
    CGFloat currentAttackRate;
    CGFloat currentHP;
    
    CCSprite* staySprite;
    ASJSkill* currentSkill;
    
    NSMutableDictionary* skills;
    
    ASJStage* worldStage;
    CCLayer*  worldLayer;
    
}

@property CGPoint movingSpeed; 
@property CGFloat attackRate;
@property CGFloat attackRange;
@property CGFloat ATP;       
@property CGFloat HP;       

@property CGPoint currentMovingSpeed;
@property CGFloat currentAttackRate;
@property CGFloat currentHP;

@property (nonatomic, retain) CCSprite* staySprite;
@property (nonatomic, retain) ASJSkill* currentSkill;
@property (nonatomic, assign) CCLayer*  worldLayer;
@property (nonatomic, assign) ASJStage* worldStage;
@property CGPoint position;


- (void)setSkill:(ASJSkill*)skill forName:(NSString*)name;
- (ASJSkill*)skillByName:(NSString*)name;
- (ASJRunSkillResult)runSkillByName:(NSString*)name;
- (ASJRunSkillResult)runSkillByName:(NSString*)name frameCount:(NSInteger)count;

@end
